package com.diaosidadui.demo;

public class Demo04 {
    public static void main(String[] args) {
        int sumOdd = 0, sumEven = 0;
        for (int i = 1; i <= 100; i++) {
//每次取得i的值
            if (i % 2 == 0) {
                sumEven += i;
            }
        }
        System.out.println("1-100之间的偶数和:" + sumEven);

        for (int i = 1; i <= 100; i++) {
            //每次取得i的值
            if(i%2==1){
                sumOdd+=i;
            }
        }
        System.out.println("1-100之间的奇数和:" + sumOdd);

        double multiply =1;
        for (int i = 1; i <= 50; i++) {
            multiply*=i;

        }
        System.out.println("1-50的阶乘是:"+multiply);
    }
}
